#ifndef AST_EXPRESSION_SHIFT_EXPR_H
#define AST_EXPRESSION_SHIFT_EXPR_H

#include "../ASTNode.h"

class AdditiveExpr;
/*
C99 6.5.7
shift-expression:
		additive-expression
		shift-expression    <<    additive-expression
		shift-expression    >>    additive-expression
*/
class ShiftExpr : public ASTNode
{
public:
	enum{
		single_expr,
		left_shift_expr,
		right_shift_expr
	};
protected:
	ShiftExpr(void)
		: ASTNode(ASTNode::shift_expression){};
public:
	ShiftExpr(AdditiveExpr *pSingleExpr)
		: ASTNode(ASTNode::shift_expression)
		, m_pSingleExpr(pSingleExpr)
		, m_iType(single_expr){};
	ShiftExpr(ShiftExpr * pShiftExpr, int iType, AdditiveExpr *pAddExpr)
		: ASTNode(ASTNode::shift_expression)
		, m_pShiftExpr(pShiftExpr)
		, m_iType(iType)
		, m_pAddExpr(pAddExpr){};


	virtual ~ShiftExpr(void);

	virtual void				codeGen();
protected:
	tiny_int			m_iType;
	union{
		AdditiveExpr *				m_pSingleExpr;
		struct{
			ShiftExpr *				m_pShiftExpr;
			AdditiveExpr *			m_pAddExpr;
		};
	};
};


#endif

